/*
 * @desc:
 * @LastEditTime: 2024-03-19 18:33:45
 * @params:
 * @return::
 */
const mongoose = require("mongoose");
const baseModle = require("./base-model");
const md5 = require("../util/md5");

const userSchema = new mongoose.Schema({
  ...baseModle,
  openId: {
    type: String,
    require: true,
  },
  userName: {
    type: String,
    require: true,
  },
  userPermissions: {
    type: Number,
    default: 0,
  },
  nickName: {
    type: String,
    // require: true,
    default: "微信用户",
  },
  avatarUrl: {
    type: String,
    default:
      "https://img.51miz.com/Element/00/88/08/86/716b81c7_E880886_bebe0ef3.png",
  },
  city: {
    type: String,
    default: "",
  },
  province: {
    type: String,
    default: "",
  },
  country: {
    type: String,
    default: "",
  },
  permissions: {
    type: Number,
    default: 0, //0是普通用户 1是超级用户
  },
  favouriteAuthor: {
    type: [String],
    default: [],
  },
  follows: {
    type: [String],
    default: [],
  },
  favouriteArticle: {
    type: [String],
    default: [],
  },
});

module.exports = userSchema;
